package com.wfh.service;

import com.mybatisflex.core.query.QueryWrapper;

import com.mybatisflex.core.service.IService;
import com.wfh.model.dto.UserLoginRequest;
import com.wfh.model.dto.UserQueryRequest;
import com.wfh.model.dto.UserRegisterRequest;
import com.wfh.model.entity.User;
import com.wfh.model.vo.UserVO;
import jakarta.servlet.http.HttpServletRequest;


import java.util.List;

/**
 * 用户表 服务层。
 *
 * @author wangfenghuan
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     *
     * @param request
     * @return
     */
    long userRegister(UserRegisterRequest request);

    /**
     * 获取uservo对象
     *
     * @param user
     * @return
     */
    UserVO getLoginUserVo(User user);

    /**
     * 获取uservo列表
     *
     * @param users
     * @return
     */
    List<UserVO> getUserVoList(List<User> users);

    /**
     * 获取查询包装类
     *
     * @param user
     * @return
     */
    QueryWrapper getUserWrapper(UserQueryRequest user);

    /**
     * 用户登录
     *
     * @param request
     * @param httpServletRequest
     * @return
     */
    UserVO userLogin(UserLoginRequest request, HttpServletRequest httpServletRequest);

    /**
     * 获取当前登录用户
     * @param httpServletRequest
     * @return
     */
    User getLoginUser(HttpServletRequest httpServletRequest);

    /**
     * 退出登录
     * @param httpServletRequest
     * @return
     */
    Boolean userLogout(HttpServletRequest httpServletRequest);

    UserVO getUserVO(User user);
}
